var mapconfig ={};

mapconfig.symbols ={};
mapconfig.layerDefs={};
mapconfig.renderers={};
mapconfig.templates={};
mapconfig.labels = {};

/*雨量站*/
mapconfig.symbols.pp = {
    "color": [255,0,0,255],
    "size": 10,
    "xoffset": 0,
    "yoffset": 0,
    "type": "esriSMS",
    "style": "esriSMSPath",
    "outline": {
        "color": [0,0,0,255],
        "width": 1.33,
        "type": "esriSLS",
        "style": "esriSLSSolid"
    },
    path: "M274.995 515.693c0.081-134.554 109.446-243.835 244.031-243.847 134.191-0.005 244.031 109.259 244.083 242.817 0.054 136.495-108.866 245.334-245.487 245.305-133.452-0.029-242.708-110.027-242.626-244.271z"
    // path: "m60.27306,0.75l0,13.105419c-33.296544,1.839357 -59.523059,21.340723 -59.523059,45.126955c0,-4.284866 7.247694,-7.765013 16.172756,-7.765013c8.930288,0 16.177982,3.480147 16.177982,7.765013c0,-4.284866 7.242469,-7.765013 16.172756,-7.765013c4.248288,0 8.109893,0.81517 10.999565,2.100629l0,63.896758c0,2.858319 -2.320098,5.173192 -5.173192,5.173192c-2.858319,0 -5.178417,-2.314873 -5.178417,-5.173192l0,-2.591821l-10.351609,0l0,2.591821c0,8.574957 6.960295,15.535252 15.530027,15.535252s15.524801,-6.960295 15.524801,-15.535252l0,-63.896758c2.889672,-1.290685 6.756502,-2.100629 11.00479,-2.100629c8.919837,0 16.177982,3.480147 16.177982,7.765013c0,-4.284866 7.247694,-7.765013 16.167531,-7.765013c8.940739,0 16.188433,3.480147 16.188433,7.765013c0,-23.781006 -26.231741,-43.282372 -59.53351,-45.126955l0,-13.105419l-10.356835,0z"
    
};
mapconfig.layerDefs.pp={
    "geometryType": "esriGeometryPoint",
    // "objectIdField": "ObjectID",
    "fields": [
        {
            "name": "stcd",
            "alias": "stcd",
            "type": "esriFieldTypeString"
        },
        {
            "name": "stnm",
            "alias": "stnm",
            "type": "esriFieldTypeString"
        }
    ],
    "drawingInfo": {
        "renderer": {
            "type": "simple",
            "symbol": mapconfig.symbols.pp
        }
    }
};
mapconfig.templates.pp = {
    title: "${stnm}(${stcd})",
    content:"<b>站名:&nbsp</b>${stnm}" +
    "<br><b>类型:&nbsp</b>雨量站" +
    "<br><b>站址:&nbsp</b>${stlc}" +
    "<br><b>时间:&nbsp</b>2016-12-08 08:00" +
    "<br><b>水位:&nbsp</b>23.92m" +
    "<br><b>流量:&nbsp</b>46m³/s"
};
mapconfig.labels.pp = {
    "labelExpressionInfo": {"value": "{stnm}"},
    "useCodedValues": false,
    "labelPlacement":"below-center",
    "minScale":2000000,
    "symbol": {
        "type": "esriTS",
        "color": [0, 0, 0, 255], //字体颜色
        "horizontalAlignment": "center",
        "rotated": false,
        "kerning": true,
        "font": {
            "size": 9,
            "style": "normal",
            "variant": "normal",
            "weight": "bold",
            "family": "微软雅黑"
        }
    }
};



/*水文水位站*/
mapconfig.symbols.zq = {
    color: [42,99,175,255],
    size: 14,
    type: "esriSMS",
    style: "esriSMSPath",
    outline: {
        color: [0,0,0,255],
        width: 0.75,
        type: "esriSLS",
        style: "esriSLSSolid"
    },
    path: "M174.043 1022L512 4.705 849.957 1022z"
    // path: "m12.218414,53.04316c-7.272338,-2.800742 -12.484909,-11.700045 -11.300301,-19.292762c0.746978,-4.787784 16.506336,-33.852974 17.882627,-32.981182c0.449203,0.28454 4.446549,7.060855 8.88299,15.058481c7.106713,12.811353 8.066253,15.200274 8.066253,20.082171c0,9.895403 -7.726898,18.00086 -17.004641,17.837744c-2.707376,-0.047606 -5.644495,-0.364609 -6.526928,-0.704451l0,-0.000002zm7.286061,-4.977024c0.240718,-1.281103 -0.321586,-1.905892 -1.715303,-1.905892c-3.176423,0 -7.582637,-4.123284 -8.567052,-8.016942c-1.050104,-4.153476 -3.834397,-4.647448 -4.245652,-0.753235c-0.79234,7.502756 13.19315,17.780141 14.528005,10.676069l0.000002,0z"
};
mapconfig.symbols.zz = {
    color: [255,255,255,245],
    size: 12,
    type: "esriSMS",
    style: "esriSMSPath",
    outline: {
        color: [255,0,0,255],
        width: 1.33,
        type: "esriSLS",
        style: "esriSLSSolid"
    },
    path: "m0.5,0.5l5.89286,18l5.10714,-18l-11,0z"
};
mapconfig.layerDefs.sw={
    "geometryType": "esriGeometryPoint",
    // "objectIdField": "ObjectID",
    "fields": [
        {
            "name": "ObjectID",
            "alias": "ObjectID",
            "type": "esriFieldTypeOID"
        },
        {
            "name": "stcd",
            "alias": "stcd",
            "type": "esriFieldTypeString"
        },
        {
            "name": "stnm",
            "alias": "stnm",
            "type": "esriFieldTypeString"
        },
        {
            "name": "sttp",
            "alias": "sttp",
            "type": "esriFieldTypeString"
        }
    ],
    "drawingInfo": {
        "renderer": {
            "type": "uniqueValue",
            "field1": "sttp",
            "uniqueValueInfos": [
                {
                    "value": "ZQ",
                    "symbol": mapconfig.symbols.zq
                },
                {
                    "value": "ZZ",
                    "symbol": mapconfig.symbols.zz
                }
            ]
        }
    }
};
mapconfig.templates.sw = {
    title: "${stnm}(${stcd})",
    content:"<b>站名:&nbsp</b>${stnm}" +
    "<br><b>类型:&nbsp</b>水文站" +
    "<br><b>站址:&nbsp</b>${stlc}" +
    "<br><b>时间:&nbsp</b>2016-12-08 08:00" +
    "<br><b>水位:&nbsp</b>23.92m" +
    "<br><b>流量:&nbsp</b>46m³/s"
};
mapconfig.labels.sw = {
    "labelExpressionInfo": {"value": "{stnm}"},
    "useCodedValues": false,
    "labelPlacement":"below-center",
    // "maxScale":100000,
    "minScale":2000000,
    "symbol": {
        "type": "esriTS",
        "color": [0, 0, 0, 255],
        "horizontalAlignment": "center",
        // "haloColor":[255, 255, 255, 255],
        // "haloSize":1,
        // "backgroundColor" : [255, 0, 0, 255],
        // "borderLineColor" : [255, 0, 0, 255],
        // "angle": 0,
        // "xoffset": 0,
        // "yoffset": -3,
        "rotated": false,
        "kerning": true,
        "font": {
            "size": 9,
            "style": "normal",
            "variant": "normal",
            "weight": "bold",
            "family": "微软雅黑"
        }
    }
};



/*水质站*/
mapconfig.symbols.szz={};
mapconfig.symbols.szz.level1 = {
    type: "esriSMS",
    style: "esriSMSCircle",
    color: [0,255,0,255],
    size: 8,
    angle: 0,
    outline: {
        type: "esriSLS",
        style: "esriSLSSolid",
        color: [0,0,0,255],
        width: 1
    }
};
mapconfig.symbols.szz.level2 = {
    type: "esriSMS",
    style: "esriSMSCircle",
    color: [5,113,176,255],
    size: 8,
    angle: 0,
    outline: {
        type: "esriSLS",
        style: "esriSLSSolid",
        color: [0,0,0,255],
        width: 1
    }
};
mapconfig.symbols.szz.level3 = {
    type: "esriSMS",
    style: "esriSMSCircle",
    color: [244,165,130,255],
    size: 8,
    angle: 0,
    outline: {
        type: "esriSLS",
        style: "esriSLSSolid",
        color: [0,0,0,255],
        width: 1
    }
};
mapconfig.symbols.szz.level4 = {
    type: "esriSMS",
    style: "esriSMSCircle",
    color: [255,0,0,255],
    size: 8,
    angle: 0,
    outline: {
        type: "esriSLS",
        style: "esriSLSSolid",
        color: [0,0,0,255],
        width: 1
    }
};
mapconfig.symbols.szz.alarm = {
    type:"esriPMS",
    url:"resources/images/map/flash.gif",
    height:12,
    width:12
};
mapconfig.symbols.wq = {
    color: [92,251,24,255],
    size: 14,
    xoffset: 0,
    yoffset: 0,
    type: "esriSMS",
    style: "esriSMSPath",
    outline: {
        "color": [0,0,0,255],
        "width": 1.33,
        "type": "esriSLS",
        "style": "esriSLSSolid"
    },
    path: "M828.816602 706.208577C828.816602 881.724975 686.980247 1024 512 1024 337.019753 1024 195.183398 881.724975 195.183398 706.208577 195.183398 530.740921 512 0 512 0 512 0 828.816602 530.740921 828.816602 706.208577Z"
};
mapconfig.layerDefs.wq2 = {
    "geometryType": "esriGeometryPoint",
    "fields": [
        {
            "name": "stcd",
            "alias": "stcd",
            "type": "esriFieldTypeString"
        },
        {
            "name": "stnm",
            "alias": "stnm",
            "type": "esriFieldTypeString"
        }
    ],
    "drawingInfo": {
        "renderer": {
            "type": "simple",
            "symbol": mapconfig.symbols.wq
        }
    }
};
mapconfig.layerDefs.wq={
    "geometryType": "esriGeometryPoint",
    "fields": [
        {
            "name": "stcd",
            "alias": "stcd",
            "type": "esriFieldTypeString"
        },
        {
            "name": "stnm",
            "alias": "stnm",
            "type": "esriFieldTypeString"
        }
    ],
    "drawingInfo": {
        "renderer": {
            "type": "uniqueValue",
            "field1": "level",
            "uniqueValueInfos": [
                {
                    "value": "1",
                    "label": "Ⅰ类水质",
                    // "description": "South Florida",
                    "symbol": mapconfig.symbols.szz.level1
                },
                {
                    "value": "2",
                    "label": "Ⅱ类水质",
                    "symbol": mapconfig.symbols.szz.level2
                },
                {
                    "value": "3",
                    "label": "Ⅲ类水质",
                    "symbol": mapconfig.symbols.szz.level3
                },
                {
                    "value": "4",
                    "label": "Ⅳ类水质",
                    "symbol": mapconfig.symbols.szz.level4
                },
                {
                    "value": "5",
                    "label": "Ⅴ类水质",
                    "symbol": mapconfig.symbols.szz.alarm
                }
            ]
        }
    }
};
mapconfig.labels.wq = {
    "labelExpressionInfo": {"value": "{stnm}"},
    "useCodedValues": false,
    "labelPlacement":"below-center",
    "symbol": {
        "type": "esriTS",
        "color": [0, 0, 0, 255],
        "horizontalAlignment": "center",
        "rotated": false,
        "kerning": true,
        "font": {
            "size": 10,
            "style": "normal",
            "variant": "normal",
            "weight": "bold",
            "family": "微软雅黑"
        }
    }
};


mapconfig.symbols.boundary = {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "color": [85,255,0,32],
    "outline": {
        "color": [0,92,230,255],
        "width": 1.2,
        "type": "esriSLS",
        "style": "esriSLSSolid"
    }
};







mapconfig.templates.wq = {
    title: "${stcd} | ${stnm}",
    content:"<b>站名:&nbsp</b>${stnm}" +
    "<br><b>时间:&nbsp</b>2016-12-08 08:00" +
    "<br><b>PH:&nbsp</b>7.25" +
    "<br><b>溶解氧:&nbsp</b>10.99" +
    "<br><b>氨氮:&nbsp</b>0.66" +
    "<br><b>总有机碳:&nbsp</b>1.42" +
    "<br><b>高锰酸盐指数:&nbsp</b>3.56"+
    "<br><b>站点情况:&nbsp</b>正常"
};



